#include "Resizable2DInterface.h"

Resizable2DInterface::Resizable2DInterface()
{
	canvas = NULL;
	d_id = -1;
}
int Resizable2DInterface::getID()
{
	return d_id;
}
void Resizable2DInterface::setColor(int r, int g, int b)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).setColor(Color(r,g,b));
}
void Resizable2DInterface::setColor(int r, int g, int b, int a)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).setColor(Color(r,g,b,a));
}
void Resizable2DInterface::setColor(Color c)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).setColor(c);
}
Color Resizable2DInterface::getColor()
{
	if(canvas != NULL)
		return canvas->getDrawing(d_id).getColor();
	return 0;
}
OSL_COLOR Resizable2DInterface::osl_c()
{
	if(canvas != NULL)
		return canvas->getDrawing(d_id).getColor().osl_c();
	return RGB(0,0,0);
}
unsigned int Resizable2DInterface::gu_c()
{
	if(canvas != NULL)
		return canvas->getDrawing(d_id).getColor().gu_c();
	return Color(0,0,0).gu_c();
}
void Resizable2DInterface::setX(int _x)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).setX(_x);
}
void Resizable2DInterface::setY(int _y)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).setY(_y);
}
void Resizable2DInterface::move(int dx, int dy)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).move(dx,dy);
}
void Resizable2DInterface::moveTo(int _x, int _y)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).moveTo(_x,_y);
}
void Resizable2DInterface::moveTo(Location point)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).moveTo(point.getX(),point.getY());
}
void Resizable2DInterface::hide()
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).hide();
}
void Resizable2DInterface::show()
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).show();
}
void Resizable2DInterface::setVisibility(bool _vis)
{
	if(canvas != NULL)
		canvas->getDrawing(d_id).setVisibility(_vis);
}
bool Resizable2DInterface::toggleVisibility()
{
	if(canvas != NULL)
		return canvas->getDrawing(d_id).toggleVisibility();
	return false;
}
int Resizable2DInterface::getX()
{
	if(canvas != NULL)
		return canvas->getDrawing(d_id).getX();
	return 0;
}
int Resizable2DInterface::getY()
{
	if(canvas != NULL)
		return canvas->getDrawing(d_id).getY();
	return 0;
}
Location Resizable2DInterface::getLocation()
{
	if(canvas != NULL)
		return canvas->getDrawing(d_id).getLocation();
	return Location(0);
}
bool Resizable2DInterface::isVisible()
{
	if(canvas != NULL)
		return canvas->getDrawing(d_id).isVisible();
	return false;
}
string Resizable2DInterface::toString()
{
	return "Default Resizable2DInterface";
}
